home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1995 August: Tool Chest / Dev.CD Aug 95 TC / Dev.CD Aug 95 TC.toast / Tool Chest / Interfaces / UniversalInterfaces 2.1B1 / AIncludes / Connections.a < prev    next >
Encoding:
Text File  |  1995-04-18  |  12.8 KB  |  542 lines  |  [TEXT/MPS ]

  1. ;
  2. ;    File:        Connections.a
  3. ;
  4. ;    Contains:    Communications Toolbox Connection Manager Interfaces.
  5. ;
  6. ;    Version:    Technology:    System 7.5
  7. ;                Package:    Universal Interfaces 2.1ß1 in “MPW Prerelease” on ETO #17
  8. ;
  9. ;    Copyright:    © 1984-1995 by Apple Computer, Inc.
  10. ;                All rights reserved.
  11. ;
  12. ;    Bugs?:        If you find a problem with this file, use the Apple Bug Reporter
  13. ;                stack.  Include the file and version information (from above)
  14. ;                in the problem description and send to:
  15. ;                    Internet:    apple.bugs@applelink.apple.com
  16. ;                    AppleLink:    APPLE.BUGS
  17. ;
  18. ;
  19.  
  20.     IF &TYPE('__CONNECTIONS__') = 'UNDEFINED' THEN
  21. __CONNECTIONS__ SET 1
  22.  
  23.  
  24.     IF &TYPE('__WINDOWS__') = 'UNDEFINED' THEN
  25.     include 'Windows.a'
  26.     ENDIF
  27. ;        include 'Types.a'                                            ;
  28. ;            include 'ConditionalMacros.a'                            ;
  29. ;        include 'Memory.a'                                            ;
  30. ;            include 'MixedMode.a'                                    ;
  31. ;        include 'Quickdraw.a'                                        ;
  32. ;            include 'QuickdrawText.a'                                ;
  33. ;        include 'Events.a'                                            ;
  34. ;            include 'OSUtils.a'                                    ;
  35. ;        include 'Controls.a'                                        ;
  36. ;            include 'Menus.a'                                        ;
  37.  
  38.     IF &TYPE('__DIALOGS__') = 'UNDEFINED' THEN
  39.     include 'Dialogs.a'
  40.     ENDIF
  41. ;        include 'Errors.a'                                            ;
  42. ;        include 'TextEdit.a'                                        ;
  43.  
  44.     IF &TYPE('__CTBUTILITIES__') = 'UNDEFINED' THEN
  45.     include 'CTBUtilities.a'
  46.     ENDIF
  47. ;        include 'StandardFile.a'                                    ;
  48. ;            include 'Files.a'                                        ;
  49. ;        include 'AppleTalk.a'                                        ;
  50.  
  51. ;    current Connection Manager version    
  52. curCMVersion                    EQU        2
  53. ;    current Connection Manager Environment Record version     
  54. curConnEnvRecVers                EQU        0
  55. ; CMErr 
  56. cmGenericError                    EQU        -1
  57. cmNoErr                            EQU        0
  58. cmRejected                        EQU        1
  59. cmFailed                        EQU        2
  60. cmTimeOut                        EQU        3
  61. cmNotOpen                        EQU        4
  62. cmNotClosed                        EQU        5
  63. cmNoRequestPending                EQU        6
  64. cmNotSupported                    EQU        7
  65. cmNoTools                        EQU        8
  66. cmUserCancel                    EQU        9
  67. cmUnknownError                    EQU        11
  68.  
  69. ; typedef OSErr             CMErr
  70.  
  71. cmData                            EQU        1 << 0
  72. cmCntl                            EQU        1 << 1
  73. cmAttn                            EQU        1 << 2
  74. cmDataNoTimeout                    EQU        1 << 4
  75. cmCntlNoTimeout                    EQU        1 << 5
  76. cmAttnNoTimeout                    EQU        1 << 6
  77. cmDataClean                        EQU        1 << 8
  78. cmCntlClean                        EQU        1 << 9
  79. cmAttnClean                        EQU        1 << 10
  80. ;        Only for CMRecFlags (not CMChannel) in the rest of this enum    
  81. cmNoMenus                        EQU        1 << 16
  82. cmQuiet                            EQU        1 << 17
  83. cmConfigChanged                    EQU        1 << 18
  84.  
  85. ; CMRecFlags and CMChannel        
  86. ;        Low word of CMRecFlags is same as CMChannel    
  87. ; typedef long                 CMRecFlags
  88. ; typedef short             CMChannel
  89.  
  90. cmStatusOpening                    EQU        1 << 0
  91. cmStatusOpen                    EQU        1 << 1
  92. cmStatusClosing                    EQU        1 << 2
  93. cmStatusDataAvail                EQU        1 << 3
  94. cmStatusCntlAvail                EQU        1 << 4
  95. cmStatusAttnAvail                EQU        1 << 5
  96. cmStatusDRPend                    EQU        1 << 6                ; data read pending    
  97. cmStatusDWPend                    EQU        1 << 7                ; data write pending    
  98. cmStatusCRPend                    EQU        1 << 8                ; cntl read pending    
  99. cmStatusCWPend                    EQU        1 << 9                ; cntl write pending    
  100. cmStatusARPend                    EQU        1 << 10                ; attn read pending    
  101. cmStatusAWPend                    EQU        1 << 11                ; attn write pending    
  102. cmStatusBreakPend                EQU        1 << 12
  103. cmStatusListenPend                EQU        1 << 13
  104. cmStatusIncomingCallPresent        EQU        1 << 14
  105. cmStatusReserved0                EQU        1 << 15
  106.  
  107. ; typedef unsigned long     CMStatFlags
  108.  
  109. cmDataIn                        EQU        0
  110. cmDataOut                        EQU        1
  111. cmCntlIn                        EQU        2
  112. cmCntlOut                        EQU        3
  113. cmAttnIn                        EQU        4
  114. cmAttnOut                        EQU        5
  115. cmRsrvIn                        EQU        6
  116. cmRsrvOut                        EQU        7
  117.  
  118. ; typedef unsigned short     CMBufFields
  119. ; typedef Ptr                 CMBuffers[8]
  120. ; typedef long                 CMBufferSizes[8]
  121.  
  122. cmSearchSevenBit                EQU        1 << 0
  123.  
  124. ; typedef unsigned short     CMSearchFlags
  125.  
  126. cmFlagsEOM                        EQU        1 << 0
  127.  
  128. ; typedef unsigned short     CMFlags
  129. ConnEnvironRec             RECORD    0
  130. version                     ds.w   1        ; offset: $0 (0)
  131. baudRate                 ds.l   1        ; offset: $2 (2)
  132. dataBits                 ds.w   1        ; offset: $6 (6)
  133. channels                 ds.w   1        ; offset: $8 (8)
  134. swFlowControl             ds.b   1        ; offset: $A (10)
  135. hwFlowControl             ds.b   1        ; offset: $B (11)
  136. flags                     ds.w   1        ; offset: $C (12)
  137. sizeof                     EQU *            ; size:   $E (14)
  138.                         ENDR
  139.  
  140. ; typedef struct ConnEnvironRec  ConnEnvironRec
  141. ; typedef ConnEnvironRec     *ConnEnvironRecPtr
  142. ; typedef struct ConnRecord  ConnRecord, *ConnPtr, **ConnHandle
  143. ConnRecord                 RECORD    0
  144. procID                     ds.w   1        ; offset: $0 (0)
  145. flags                     ds.l   1        ; offset: $2 (2)
  146. errCode                     ds.w   1        ; offset: $6 (6)
  147. refCon                     ds.l   1        ; offset: $8 (8)
  148. userData                 ds.l   1        ; offset: $C (12)
  149. defProc                     ds.l   1        ; offset: $10 (16)
  150. config                     ds.l   1        ; offset: $14 (20)
  151. oldConfig                 ds.l   1        ; offset: $18 (24)
  152. asyncEOM                 ds.l   1        ; offset: $1C (28)
  153. reserved1                 ds.l   1        ; offset: $20 (32)
  154. reserved2                 ds.l   1        ; offset: $24 (36)
  155. cmPrivate                 ds.l   1        ; offset: $28 (40)
  156. bufferArray                 ds.l   8        ; offset: $2C (44)
  157. bufSizes                 ds.l   8        ; offset: $4C (76)
  158. mluField                 ds.l   1        ; offset: $6C (108)
  159. asyncCount                 ds.l   8        ; offset: $70 (112)
  160. sizeof                     EQU *            ; size:   $90 (144)
  161.                         ENDR
  162.  
  163.  
  164. ; CMIOPB constants and structure 
  165. cmIOPBQType                        EQU        10
  166. cmIOPBversion                    EQU        0
  167.  
  168. CMIOPB                     RECORD    0
  169. qLink                     ds.l   1        ; offset: $0 (0)
  170. qType                     ds.w   1        ; offset: $4 (4)        ; cmIOPBQType 
  171. hConn                     ds.l   1        ; offset: $6 (6)
  172. theBuffer                 ds.l   1        ; offset: $A (10)
  173. count                     ds.l   1        ; offset: $E (14)
  174. flags                     ds.w   1        ; offset: $12 (18)
  175. userCompletion             ds.l   1        ; offset: $14 (20)
  176. timeout                     ds.l   1        ; offset: $18 (24)
  177. errCode                     ds.w   1        ; offset: $1C (28)
  178. channel                     ds.w   1        ; offset: $1E (30)
  179. asyncEOM                 ds.l   1        ; offset: $20 (32)
  180. reserved1                 ds.l   1        ; offset: $24 (36)
  181. reserved2                 ds.w   1        ; offset: $28 (40)
  182. version                     ds.w   1        ; offset: $2A (42)        ; cmIOPBversion 
  183. refCon                     ds.l   1        ; offset: $2C (44)        ; for application 
  184. toolData1                 ds.l   1        ; offset: $30 (48)        ; for tool 
  185. toolData2                 ds.l   1        ; offset: $34 (52)        ; for tool 
  186. sizeof                     EQU *            ; size:   $38 (56)
  187.                         ENDR
  188.  
  189. ; typedef struct CMIOPB     CMIOPB
  190. ; typedef CMIOPB             *CMIOPBPtr
  191. ;
  192. ; pascal CMErr InitCM(void)
  193. ;
  194.     IF GENERATINGCFM THEN
  195.         IMPORT_CFM_FUNCTION    InitCM
  196.     ENDIF
  197.  
  198. ;
  199. ; pascal Handle CMGetVersion(ConnHandle hConn)
  200. ;
  201.     IF GENERATINGCFM THEN
  202.         IMPORT_CFM_FUNCTION    CMGetVersion
  203.     ENDIF
  204.  
  205. ;
  206. ; pascal short CMGetCMVersion(void)
  207. ;
  208.     IF GENERATINGCFM THEN
  209.         IMPORT_CFM_FUNCTION    CMGetCMVersion
  210.     ENDIF
  211.  
  212. ;
  213. ; pascal ConnHandle CMNew(short procID, CMRecFlags flags, CMBufferSizes desiredSizes, long refCon, long userData)
  214. ;
  215.     IF GENERATINGCFM THEN
  216.         IMPORT_CFM_FUNCTION    CMNew
  217.     ENDIF
  218.  
  219. ;
  220. ; pascal void CMDispose(ConnHandle hConn)
  221. ;
  222.     IF GENERATINGCFM THEN
  223.         IMPORT_CFM_FUNCTION    CMDispose
  224.     ENDIF
  225.  
  226. ;
  227. ; pascal CMErr CMListen(ConnHandle hConn, Boolean async, ConnectionCompletionUPP completor, long timeout)
  228. ;
  229.     IF GENERATINGCFM THEN
  230.         IMPORT_CFM_FUNCTION    CMListen
  231.     ENDIF
  232.  
  233. ;
  234. ; pascal CMErr CMAccept(ConnHandle hConn, Boolean accept)
  235. ;
  236.     IF GENERATINGCFM THEN
  237.         IMPORT_CFM_FUNCTION    CMAccept
  238.     ENDIF
  239.  
  240. ;
  241. ; pascal CMErr CMOpen(ConnHandle hConn, Boolean async, ConnectionCompletionUPP completor, long timeout)
  242. ;
  243.     IF GENERATINGCFM THEN
  244.         IMPORT_CFM_FUNCTION    CMOpen
  245.     ENDIF
  246.  
  247. ;
  248. ; pascal CMErr CMClose(ConnHandle hConn, Boolean async, ConnectionCompletionUPP completor, long timeout, Boolean now)
  249. ;
  250.     IF GENERATINGCFM THEN
  251.         IMPORT_CFM_FUNCTION    CMClose
  252.     ENDIF
  253.  
  254. ;
  255. ; pascal CMErr CMAbort(ConnHandle hConn)
  256. ;
  257.     IF GENERATINGCFM THEN
  258.         IMPORT_CFM_FUNCTION    CMAbort
  259.     ENDIF
  260.  
  261. ;
  262. ; pascal CMErr CMStatus(ConnHandle hConn, CMBufferSizes sizes, CMStatFlags *flags)
  263. ;
  264.     IF GENERATINGCFM THEN
  265.         IMPORT_CFM_FUNCTION    CMStatus
  266.     ENDIF
  267.  
  268. ;
  269. ; pascal void CMIdle(ConnHandle hConn)
  270. ;
  271.     IF GENERATINGCFM THEN
  272.         IMPORT_CFM_FUNCTION    CMIdle
  273.     ENDIF
  274.  
  275. ;
  276. ; pascal void CMReset(ConnHandle hConn)
  277. ;
  278.     IF GENERATINGCFM THEN
  279.         IMPORT_CFM_FUNCTION    CMReset
  280.     ENDIF
  281.  
  282. ;
  283. ; pascal void CMBreak(ConnHandle hConn, long duration, Boolean async, ConnectionCompletionUPP completor)
  284. ;
  285.     IF GENERATINGCFM THEN
  286.         IMPORT_CFM_FUNCTION    CMBreak
  287.     ENDIF
  288.  
  289. ;
  290. ; pascal CMErr CMRead(ConnHandle hConn, void *theBuffer, long *toRead, CMChannel theChannel, Boolean async, ConnectionCompletionUPP completor, long timeout, CMFlags *flags)
  291. ;
  292.     IF GENERATINGCFM THEN
  293.         IMPORT_CFM_FUNCTION    CMRead
  294.     ENDIF
  295.  
  296. ;
  297. ; pascal CMErr CMWrite(ConnHandle hConn, const void *theBuffer, long *toWrite, CMChannel theChannel, Boolean async, ConnectionCompletionUPP completor, long timeout, CMFlags flags)
  298. ;
  299.     IF GENERATINGCFM THEN
  300.         IMPORT_CFM_FUNCTION    CMWrite
  301.     ENDIF
  302.  
  303. ;
  304. ; pascal CMErr CMIOKill(ConnHandle hConn, short which)
  305. ;
  306.     IF GENERATINGCFM THEN
  307.         IMPORT_CFM_FUNCTION    CMIOKill
  308.     ENDIF
  309.  
  310. ;
  311. ; pascal void CMActivate(ConnHandle hConn, Boolean activate)
  312. ;
  313.     IF GENERATINGCFM THEN
  314.         IMPORT_CFM_FUNCTION    CMActivate
  315.     ENDIF
  316.  
  317. ;
  318. ; pascal void CMResume(ConnHandle hConn, Boolean resume)
  319. ;
  320.     IF GENERATINGCFM THEN
  321.         IMPORT_CFM_FUNCTION    CMResume
  322.     ENDIF
  323.  
  324. ;
  325. ; pascal Boolean CMMenu(ConnHandle hConn, short menuID, short item)
  326. ;
  327.     IF GENERATINGCFM THEN
  328.         IMPORT_CFM_FUNCTION    CMMenu
  329.     ENDIF
  330.  
  331. ;
  332. ; pascal Boolean CMValidate(ConnHandle hConn)
  333. ;
  334.     IF GENERATINGCFM THEN
  335.         IMPORT_CFM_FUNCTION    CMValidate
  336.     ENDIF
  337.  
  338. ;
  339. ; pascal void CMDefault(Ptr *theConfig, short procID, Boolean allocate)
  340. ;
  341.     IF GENERATINGCFM THEN
  342.         IMPORT_CFM_FUNCTION    CMDefault
  343.     ENDIF
  344.  
  345. ;
  346. ; pascal Handle CMSetupPreflight(short procID, long *magicCookie)
  347. ;
  348.     IF GENERATINGCFM THEN
  349.         IMPORT_CFM_FUNCTION    CMSetupPreflight
  350.     ENDIF
  351.  
  352. ;
  353. ; pascal Boolean CMSetupFilter(short procID, const void *theConfig, short count, DialogPtr theDialog, EventRecord *theEvent, short *theItem, long *magicCookie)
  354. ;
  355.     IF GENERATINGCFM THEN
  356.         IMPORT_CFM_FUNCTION    CMSetupFilter
  357.     ENDIF
  358.  
  359. ;
  360. ; pascal void CMSetupSetup(short procID, const void *theConfig, short count, DialogPtr theDialog, long *magicCookie)
  361. ;
  362.     IF GENERATINGCFM THEN
  363.         IMPORT_CFM_FUNCTION    CMSetupSetup
  364.     ENDIF
  365.  
  366. ;
  367. ; pascal void CMSetupItem(short procID, const void *theConfig, short count, DialogPtr theDialog, short *theItem, long *magicCookie)
  368. ;
  369.     IF GENERATINGCFM THEN
  370.         IMPORT_CFM_FUNCTION    CMSetupItem
  371.     ENDIF
  372.  
  373. ;
  374. ; pascal void CMSetupXCleanup(short procID, const void *theConfig, short count, DialogPtr theDialog, Boolean OKed, long *magicCookie)
  375. ;
  376.     IF GENERATINGCFM THEN
  377.         IMPORT_CFM_FUNCTION    CMSetupXCleanup
  378.     ENDIF
  379.  
  380. ;
  381. ; pascal void CMSetupPostflight(short procID)
  382. ;
  383.     IF GENERATINGCFM THEN
  384.         IMPORT_CFM_FUNCTION    CMSetupPostflight
  385.     ENDIF
  386.  
  387. ;
  388. ; pascal Ptr CMGetConfig(ConnHandle hConn)
  389. ;
  390.     IF GENERATINGCFM THEN
  391.         IMPORT_CFM_FUNCTION    CMGetConfig
  392.     ENDIF
  393.  
  394. ;
  395. ; pascal short CMSetConfig(ConnHandle hConn, const void *thePtr)
  396. ;
  397.     IF GENERATINGCFM THEN
  398.         IMPORT_CFM_FUNCTION    CMSetConfig
  399.     ENDIF
  400.  
  401. ;
  402. ; pascal OSErr CMIntlToEnglish(ConnHandle hConn, const void *inputPtr, Ptr *outputPtr, short language)
  403. ;
  404.     IF GENERATINGCFM THEN
  405.         IMPORT_CFM_FUNCTION    CMIntlToEnglish
  406.     ENDIF
  407.  
  408. ;
  409. ; pascal OSErr CMEnglishToIntl(ConnHandle hConn, const void *inputPtr, Ptr *outputPtr, short language)
  410. ;
  411.     IF GENERATINGCFM THEN
  412.         IMPORT_CFM_FUNCTION    CMEnglishToIntl
  413.     ENDIF
  414.  
  415. ;
  416. ; pascal long CMAddSearch(ConnHandle hConn, ConstStr255Param theString, CMSearchFlags flags, ConnectionSearchCallBackUPP callBack)
  417. ;
  418.     IF GENERATINGCFM THEN
  419.         IMPORT_CFM_FUNCTION    CMAddSearch
  420.     ENDIF
  421.  
  422. ;
  423. ; pascal void CMRemoveSearch(ConnHandle hConn, long refnum)
  424. ;
  425.     IF GENERATINGCFM THEN
  426.         IMPORT_CFM_FUNCTION    CMRemoveSearch
  427.     ENDIF
  428.  
  429. ;
  430. ; pascal void CMClearSearch(ConnHandle hConn)
  431. ;
  432.     IF GENERATINGCFM THEN
  433.         IMPORT_CFM_FUNCTION    CMClearSearch
  434.     ENDIF
  435.  
  436. ;
  437. ; pascal CMErr CMGetConnEnvirons(ConnHandle hConn, ConnEnvironRec *theEnvirons)
  438. ;
  439.     IF GENERATINGCFM THEN
  440.         IMPORT_CFM_FUNCTION    CMGetConnEnvirons
  441.     ENDIF
  442.  
  443. ;
  444. ; pascal short CMChoose(ConnHandle *hConn, Point where, ConnectionChooseIdleUPP idle)
  445. ;
  446.     IF GENERATINGCFM THEN
  447.         IMPORT_CFM_FUNCTION    CMChoose
  448.     ENDIF
  449.  
  450. ;
  451. ; pascal void CMEvent(ConnHandle hConn, const EventRecord *theEvent)
  452. ;
  453.     IF GENERATINGCFM THEN
  454.         IMPORT_CFM_FUNCTION    CMEvent
  455.     ENDIF
  456.  
  457. ;
  458. ; pascal void CMGetToolName(short procID, Str255 name)
  459. ;
  460.     IF GENERATINGCFM THEN
  461.         IMPORT_CFM_FUNCTION    CMGetToolName
  462.     ENDIF
  463.  
  464. ;
  465. ; pascal short CMGetProcID(ConstStr255Param name)
  466. ;
  467.     IF GENERATINGCFM THEN
  468.         IMPORT_CFM_FUNCTION    CMGetProcID
  469.     ENDIF
  470.  
  471. ;
  472. ; pascal void CMSetRefCon(ConnHandle hConn, long refCon)
  473. ;
  474.     IF GENERATINGCFM THEN
  475.         IMPORT_CFM_FUNCTION    CMSetRefCon
  476.     ENDIF
  477.  
  478. ;
  479. ; pascal long CMGetRefCon(ConnHandle hConn)
  480. ;
  481.     IF GENERATINGCFM THEN
  482.         IMPORT_CFM_FUNCTION    CMGetRefCon
  483.     ENDIF
  484.  
  485. ;
  486. ; pascal long CMGetUserData(ConnHandle hConn)
  487. ;
  488.     IF GENERATINGCFM THEN
  489.         IMPORT_CFM_FUNCTION    CMGetUserData
  490.     ENDIF
  491.  
  492. ;
  493. ; pascal void CMSetUserData(ConnHandle hConn, long userData)
  494. ;
  495.     IF GENERATINGCFM THEN
  496.         IMPORT_CFM_FUNCTION    CMSetUserData
  497.     ENDIF
  498.  
  499. ;
  500. ; pascal void CMGetErrorString(ConnHandle hConn, short id, Str255 errMsg)
  501. ;
  502.     IF GENERATINGCFM THEN
  503.         IMPORT_CFM_FUNCTION    CMGetErrorString
  504.     ENDIF
  505.  
  506. ;
  507. ; pascal CMErr CMNewIOPB(ConnHandle hConn, CMIOPBPtr *theIOPB)
  508. ;
  509.     IF GENERATINGCFM THEN
  510.         IMPORT_CFM_FUNCTION    CMNewIOPB
  511.     ENDIF
  512.  
  513. ;
  514. ; pascal CMErr CMDisposeIOPB(ConnHandle hConn, CMIOPBPtr theIOPB)
  515. ;
  516.     IF GENERATINGCFM THEN
  517.         IMPORT_CFM_FUNCTION    CMDisposeIOPB
  518.     ENDIF
  519.  
  520. ;
  521. ; pascal CMErr CMPBRead(ConnHandle hConn, CMIOPBPtr theIOPB, Boolean async)
  522. ;
  523.     IF GENERATINGCFM THEN
  524.         IMPORT_CFM_FUNCTION    CMPBRead
  525.     ENDIF
  526.  
  527. ;
  528. ; pascal CMErr CMPBWrite(ConnHandle hConn, CMIOPBPtr theIOPB, Boolean async)
  529. ;
  530.     IF GENERATINGCFM THEN
  531.         IMPORT_CFM_FUNCTION    CMPBWrite
  532.     ENDIF
  533.  
  534. ;
  535. ; pascal CMErr CMPBIOKill(ConnHandle hConn, CMIOPBPtr theIOPB)
  536. ;
  537.     IF GENERATINGCFM THEN
  538.         IMPORT_CFM_FUNCTION    CMPBIOKill
  539.     ENDIF
  540.  
  541.     ENDIF ; __CONNECTIONS__
  542.